package com.example.controller;


import com.example.entity.Person;
import com.example.entity.Student;
import com.example.service.PersonService;
import com.example.service.StudentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 学生表 前端控制器
 * </p>
 *
 * @author fbb 2763175463@126.com
 * @since 2021-11-30
 */
@RestController
@RequestMapping("/student")
public class StudentController {
    @Autowired
    private StudentService studentService;
    @GetMapping("/selectAll")
    public Map<String,Object> selectAll(){
        Map<String, Object> map = new HashMap<>();
        List<Student> list = studentService.list();
        map.put("code",200);
        map.put("msg","查询成功");
        map.put("data",list);
        return map;
    }

}

